<template>
    <div>
      <div class="goods-desc" v-for="item in info" :key="item.id">
        <h3 class="title">{{item.attribute}}</h3>
        <hr>
        <div class="content" v-html="item.value"></div>
      </div>
    </div>
</template>

<script>
  import { getGoodsDesc } from '@/api/api'
  export default {
    name: 'goodsDesc',
    data() {
      return {
        id:this.$route.params.id,
        info: {}
      }
    },
    created() {
      this.createGoodsDesc()
    },
    methods: {
      // createGoodsDesc() {
      //   getGoodsDesc(this.id)
      //     .then(res=> {
      //       this.info = res.data.message
      //       console.log(this.info)
      //     })
      // }
      createGoodsDesc(){
        var $this=this;
        this.axios({
          method:'get',
          url: "http://localhost:8083/ecGoodsAttribute/list",
          params: {id:this.id}
        }).then(function(res){
          $this.info=res.data.obj;
        })
      }
    }

  }
</script>

<style lang="scss">
  .goods-desc {
    padding: 4px;
    h3 {
      font-size: 16px;
      color: #226aff;
      text-align: center;
      margin: 15px 0;
    }
    .content {
      img {
        width: 100%;
      }
    }
  }

</style>
